package example09;

public class Student extends Person{
    public int no;

    public double scoreEn;

    public double scoreMath;

    public double scoreCh;

//    public double aver;
//    public double max;
//     public double min;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }
    //平均分
    public double aver(){
        double s =(scoreCh+scoreEn+scoreMath)/3;
        return s;
    }
    //最高分
    public double max(){
        double m = Math.max(Math.max(scoreCh,scoreEn),scoreMath);
        return m;
    }
    //最低分
    public double min() {
        double n = Math.min(Math.min(scoreCh, scoreMath), scoreEn);
        return n;

    }

    @Override
    public String toString() {

        Student student = new Student();
        student.aver();
        student.max();
        student.min();
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", aver=" + aver() +
                ", max=" + max() +
                ", min=" + min() +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
